/**
 * 
 */
 define([], function(){
 	
	var overlayClassName = '.overlay';
 	
 	return {
 		submitOrderForm : function(order, success, error, scope){
 			var $scope = scope ? $(scope) : $('body');
 			var $overlay = $scope.closest(overlayClassName);
 			
 			var _success = function(){
 				$overlay.hide();
 				if(success){
 					success.apply(null, arguments);
 				}
 			};
 			
 			var _error = function(){
 				$overlay.hide();
 				if(error){
 					error.apply(null, arguments);
 				}
 			};
 			
 			$overlay.show();
 			$.ajax('mail.php', {
				type : 'POST',
				success: _success,
				error: _error,
				data : order
 			});
 		}
 	};
 });